

package jetbrains.buildServer.server.rest.model.pages;

import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jetbrains.annotations.NotNull;

@XmlRootElement(name = "errorList")
public class ErrorDescriptorList {
  private List<ErrorDescriptor> myErrors;
  private Integer myCount;

  public ErrorDescriptorList() { }

  public ErrorDescriptorList(@NotNull List<ErrorDescriptor> errors) {
    myErrors = errors;
    myCount = errors.size();
  }

  @XmlElement(name = "error")
  public List<ErrorDescriptor> getErrors() {
    return myErrors;
  }

  @XmlAttribute(name = "count")
  public Integer getCount() {
    return myCount;
  }
}